3.1209 \(\int \frac{(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx\)

Optimal. Leaf size=190 \[ -\frac{\left (6 a^2 b^2 d+4 a^3 b c+a^4 (-d)-4 a b^3 c-b^4 d\right ) \log (\cos (e+f x))}{f \left (c^2+d^2\right )}+\frac{x \left (-6 a^2 b^2 c+4 a^3 b d+a^4 c-4 a b^3 d+b^4 c\right )}{c^2+d^2}-\frac{b^3 (b c-3 a d) \tan (e+f x)}{d^2 f}+\frac{b^2 (a+b \tan (e+f x))^2}{2 d f}+\frac{(b c-a d)^4 \log (c+d \tan (e+f x))}{d^3 f \left (c^2+d^2\right )} \]

[Out]

((a^4*c - 6*a^2*b^2*c + b^4*c + 4*a^3*b*d - 4*a*b^3*d)*x)/(c^2 + d^2) - ((4*a^3*b*c - 4*a*b^3*c - a^4*d + 6*a^
2*b^2*d - b^4*d)*Log[Cos[e + f*x]])/((c^2 + d^2)*f) + ((b*c - a*d)^4*Log[c + d*Tan[e + f*x]])/(d^3*(c^2 + d^2)
*f) - (b^3*(b*c - 3*a*d)*Tan[e + f*x])/(d^2*f) + (b^2*(a + b*Tan[e + f*x])^2)/(2*d*f)

________________________________________________________________________________________

Rubi [A]  time = 0.491124, antiderivative size = 190, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.24, Rules used = {3566, 3637, 3626, 3617, 31, 3475} \[ -\frac{\left (6 a^2 b^2 d+4 a^3 b c+a^4 (-d)-4 a b^3 c-b^4 d\right ) \log (\cos (e+f x))}{f \left (c^2+d^2\right )}+\frac{x \left (-6 a^2 b^2 c+4 a^3 b d+a^4 c-4 a b^3 d+b^4 c\right )}{c^2+d^2}-\frac{b^3 (b c-3 a d) \tan (e+f x)}{d^2 f}+\frac{b^2 (a+b \tan (e+f x))^2}{2 d f}+\frac{(b c-a d)^4 \log (c+d \tan (e+f x))}{d^3 f \left (c^2+d^2\right )} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[e + f*x])^4/(c + d*Tan[e + f*x]),x]

[Out]

((a^4*c - 6*a^2*b^2*c + b^4*c + 4*a^3*b*d - 4*a*b^3*d)*x)/(c^2 + d^2) - ((4*a^3*b*c - 4*a*b^3*c - a^4*d + 6*a^
2*b^2*d - b^4*d)*Log[Cos[e + f*x]])/((c^2 + d^2)*f) + ((b*c - a*d)^4*Log[c + d*Tan[e + f*x]])/(d^3*(c^2 + d^2)
*f) - (b^3*(b*c - 3*a*d)*Tan[e + f*x])/(d^2*f) + (b^2*(a + b*Tan[e + f*x])^2)/(2*d*f)

Rule 3566

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[(b^2*(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^(n + 1))/(d*f*(m + n - 1)), x] + Dist[1/(d*(m + n -
1)), Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^n*Simp[a^3*d*(m + n - 1) - b^2*(b*c*(m - 2) + a*d*(
1 + n)) + b*d*(m + n - 1)*(3*a^2 - b^2)*Tan[e + f*x] - b^2*(b*c*(m - 2) - a*d*(3*m + 2*n - 4))*Tan[e + f*x]^2,
 x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
&& IntegerQ[2*m] && GtQ[m, 2] && (GeQ[n, -1] || IntegerQ[m]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0]
&& NeQ[a, 0])))

Rule 3637

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])
^(n + 1))/(d*f*(n + 2)), x] - Dist[1/(d*(n + 2)), Int[(c + d*Tan[e + f*x])^n*Simp[b*c*C - a*A*d*(n + 2) - (A*b
 + a*B - b*C)*d*(n + 2)*Tan[e + f*x] - (a*C*d*(n + 2) - b*(c*C - B*d*(n + 2)))*Tan[e + f*x]^2, x], x], x] /; F
reeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] &&  !LtQ[n, -1]

Rule 3626

Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[((a*A + b*B - a*C)*x)/(a^2 + b^2), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]

Rule 3617

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{(a+b \tan (e+f x))^4}{c+d \tan (e+f x)} \, dx &=\frac{b^2 (a+b \tan (e+f x))^2}{2 d f}+\frac{\int \frac{(a+b \tan (e+f x)) \left (-2 \left (b^3 c-a^3 d\right )+2 b \left (3 a^2-b^2\right ) d \tan (e+f x)-2 b^2 (b c-3 a d) \tan ^2(e+f x)\right )}{c+d \tan (e+f x)} \, dx}{2 d}\\ &=-\frac{b^3 (b c-3 a d) \tan (e+f x)}{d^2 f}+\frac{b^2 (a+b \tan (e+f x))^2}{2 d f}-\frac{\int \frac{-2 \left (b^4 c^2-4 a b^3 c d+a^4 d^2\right )-8 a b \left (a^2-b^2\right ) d^2 \tan (e+f x)+2 b^2 \left (4 a b c d-6 a^2 d^2-b^2 \left (c^2-d^2\right )\right ) \tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{2 d^2}\\ &=\frac{\left (a^4 c-6 a^2 b^2 c+b^4 c+4 a^3 b d-4 a b^3 d\right ) x}{c^2+d^2}-\frac{b^3 (b c-3 a d) \tan (e+f x)}{d^2 f}+\frac{b^2 (a+b \tan (e+f x))^2}{2 d f}+\frac{(b c-a d)^4 \int \frac{1+\tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{d^2 \left (c^2+d^2\right )}+\frac{\left (4 a^3 b c-4 a b^3 c-a^4 d+6 a^2 b^2 d-b^4 d\right ) \int \tan (e+f x) \, dx}{c^2+d^2}\\ &=\frac{\left (a^4 c-6 a^2 b^2 c+b^4 c+4 a^3 b d-4 a b^3 d\right ) x}{c^2+d^2}-\frac{\left (4 a^3 b c-4 a b^3 c-a^4 d+6 a^2 b^2 d-b^4 d\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right ) f}-\frac{b^3 (b c-3 a d) \tan (e+f x)}{d^2 f}+\frac{b^2 (a+b \tan (e+f x))^2}{2 d f}+\frac{(b c-a d)^4 \operatorname{Subst}\left (\int \frac{1}{c+x} \, dx,x,d \tan (e+f x)\right )}{d^3 \left (c^2+d^2\right ) f}\\ &=\frac{\left (a^4 c-6 a^2 b^2 c+b^4 c+4 a^3 b d-4 a b^3 d\right ) x}{c^2+d^2}-\frac{\left (4 a^3 b c-4 a b^3 c-a^4 d+6 a^2 b^2 d-b^4 d\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right ) f}+\frac{(b c-a d)^4 \log (c+d \tan (e+f x))}{d^3 \left (c^2+d^2\right ) f}-\frac{b^3 (b c-3 a d) \tan (e+f x)}{d^2 f}+\frac{b^2 (a+b \tan (e+f x))^2}{2 d f}\\ \end{align*}

Mathematica [C]  time = 1.2215, size = 160, normalized size = 0.84 \[ \frac{-\frac{2 b^3 (b c-3 a d) \tan (e+f x)}{d}+b^2 (a+b \tan (e+f x))^2+\frac{\frac{2 (b c-a d)^4 \log (c+d \tan (e+f x))}{d \left (c^2+d^2\right )}-\frac{d^2 (a-i b)^4 \log (\tan (e+f x)+i)}{d+i c}+\frac{d^2 (a+i b)^4 \log (-\tan (e+f x)+i)}{-d+i c}}{d}}{2 d f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tan[e + f*x])^4/(c + d*Tan[e + f*x]),x]

[Out]

((((a + I*b)^4*d^2*Log[I - Tan[e + f*x]])/(I*c - d) - ((a - I*b)^4*d^2*Log[I + Tan[e + f*x]])/(I*c + d) + (2*(
b*c - a*d)^4*Log[c + d*Tan[e + f*x]])/(d*(c^2 + d^2)))/d - (2*b^3*(b*c - 3*a*d)*Tan[e + f*x])/d + b^2*(a + b*T
an[e + f*x])^2)/(2*d*f)

________________________________________________________________________________________

Maple [B]  time = 0.029, size = 498, normalized size = 2.6 \begin{align*}{\frac{{b}^{4} \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2\,fd}}+4\,{\frac{{b}^{3}a\tan \left ( fx+e \right ) }{fd}}-{\frac{{b}^{4}c\tan \left ( fx+e \right ) }{{d}^{2}f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){a}^{4}d}{2\,f \left ({c}^{2}+{d}^{2} \right ) }}+2\,{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){a}^{3}bc}{f \left ({c}^{2}+{d}^{2} \right ) }}+3\,{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){a}^{2}{b}^{2}d}{f \left ({c}^{2}+{d}^{2} \right ) }}-2\,{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) a{b}^{3}c}{f \left ({c}^{2}+{d}^{2} \right ) }}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){b}^{4}d}{2\,f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ){a}^{4}c}{f \left ({c}^{2}+{d}^{2} \right ) }}+4\,{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ){a}^{3}bd}{f \left ({c}^{2}+{d}^{2} \right ) }}-6\,{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ){a}^{2}{b}^{2}c}{f \left ({c}^{2}+{d}^{2} \right ) }}-4\,{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) a{b}^{3}d}{f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ){b}^{4}c}{f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{d\ln \left ( c+d\tan \left ( fx+e \right ) \right ){a}^{4}}{f \left ({c}^{2}+{d}^{2} \right ) }}-4\,{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ){a}^{3}bc}{f \left ({c}^{2}+{d}^{2} \right ) }}+6\,{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ){c}^{2}{a}^{2}{b}^{2}}{fd \left ({c}^{2}+{d}^{2} \right ) }}-4\,{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ){c}^{3}a{b}^{3}}{{d}^{2}f \left ({c}^{2}+{d}^{2} \right ) }}+{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ){c}^{4}{b}^{4}}{f{d}^{3} \left ({c}^{2}+{d}^{2} \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))^4/(c+d*tan(f*x+e)),x)

[Out]

1/2/f*b^4/d*tan(f*x+e)^2+4/f*b^3/d*a*tan(f*x+e)-1/f*b^4/d^2*c*tan(f*x+e)-1/2/f/(c^2+d^2)*ln(1+tan(f*x+e)^2)*a^
4*d+2/f/(c^2+d^2)*ln(1+tan(f*x+e)^2)*a^3*b*c+3/f/(c^2+d^2)*ln(1+tan(f*x+e)^2)*a^2*b^2*d-2/f/(c^2+d^2)*ln(1+tan
(f*x+e)^2)*a*b^3*c-1/2/f/(c^2+d^2)*ln(1+tan(f*x+e)^2)*b^4*d+1/f/(c^2+d^2)*arctan(tan(f*x+e))*a^4*c+4/f/(c^2+d^
2)*arctan(tan(f*x+e))*a^3*b*d-6/f/(c^2+d^2)*arctan(tan(f*x+e))*a^2*b^2*c-4/f/(c^2+d^2)*arctan(tan(f*x+e))*a*b^
3*d+1/f/(c^2+d^2)*arctan(tan(f*x+e))*b^4*c+1/f*d/(c^2+d^2)*ln(c+d*tan(f*x+e))*a^4-4/f/(c^2+d^2)*ln(c+d*tan(f*x
+e))*a^3*b*c+6/f/d/(c^2+d^2)*ln(c+d*tan(f*x+e))*c^2*a^2*b^2-4/f/d^2/(c^2+d^2)*ln(c+d*tan(f*x+e))*c^3*a*b^3+1/f
/d^3/(c^2+d^2)*ln(c+d*tan(f*x+e))*c^4*b^4

________________________________________________________________________________________

Maxima [A]  time = 1.81071, size = 302, normalized size = 1.59 \begin{align*} \frac{\frac{2 \,{\left ({\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} c + 4 \,{\left (a^{3} b - a b^{3}\right )} d\right )}{\left (f x + e\right )}}{c^{2} + d^{2}} + \frac{2 \,{\left (b^{4} c^{4} - 4 \, a b^{3} c^{3} d + 6 \, a^{2} b^{2} c^{2} d^{2} - 4 \, a^{3} b c d^{3} + a^{4} d^{4}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{2} d^{3} + d^{5}} + \frac{{\left (4 \,{\left (a^{3} b - a b^{3}\right )} c -{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}} + \frac{b^{4} d \tan \left (f x + e\right )^{2} - 2 \,{\left (b^{4} c - 4 \, a b^{3} d\right )} \tan \left (f x + e\right )}{d^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^4/(c+d*tan(f*x+e)),x, algorithm="maxima")

[Out]

1/2*(2*((a^4 - 6*a^2*b^2 + b^4)*c + 4*(a^3*b - a*b^3)*d)*(f*x + e)/(c^2 + d^2) + 2*(b^4*c^4 - 4*a*b^3*c^3*d +
6*a^2*b^2*c^2*d^2 - 4*a^3*b*c*d^3 + a^4*d^4)*log(d*tan(f*x + e) + c)/(c^2*d^3 + d^5) + (4*(a^3*b - a*b^3)*c -
(a^4 - 6*a^2*b^2 + b^4)*d)*log(tan(f*x + e)^2 + 1)/(c^2 + d^2) + (b^4*d*tan(f*x + e)^2 - 2*(b^4*c - 4*a*b^3*d)
*tan(f*x + e))/d^2)/f

________________________________________________________________________________________

Fricas [A]  time = 2.20496, size = 630, normalized size = 3.32 \begin{align*} \frac{2 \,{\left ({\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} c d^{3} + 4 \,{\left (a^{3} b - a b^{3}\right )} d^{4}\right )} f x +{\left (b^{4} c^{2} d^{2} + b^{4} d^{4}\right )} \tan \left (f x + e\right )^{2} +{\left (b^{4} c^{4} - 4 \, a b^{3} c^{3} d + 6 \, a^{2} b^{2} c^{2} d^{2} - 4 \, a^{3} b c d^{3} + a^{4} d^{4}\right )} \log \left (\frac{d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) -{\left (b^{4} c^{4} - 4 \, a b^{3} c^{3} d + 6 \, a^{2} b^{2} c^{2} d^{2} - 4 \, a b^{3} c d^{3} +{\left (6 \, a^{2} b^{2} - b^{4}\right )} d^{4}\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \,{\left (b^{4} c^{3} d - 4 \, a b^{3} c^{2} d^{2} + b^{4} c d^{3} - 4 \, a b^{3} d^{4}\right )} \tan \left (f x + e\right )}{2 \,{\left (c^{2} d^{3} + d^{5}\right )} f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^4/(c+d*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(2*((a^4 - 6*a^2*b^2 + b^4)*c*d^3 + 4*(a^3*b - a*b^3)*d^4)*f*x + (b^4*c^2*d^2 + b^4*d^4)*tan(f*x + e)^2 +
(b^4*c^4 - 4*a*b^3*c^3*d + 6*a^2*b^2*c^2*d^2 - 4*a^3*b*c*d^3 + a^4*d^4)*log((d^2*tan(f*x + e)^2 + 2*c*d*tan(f*
x + e) + c^2)/(tan(f*x + e)^2 + 1)) - (b^4*c^4 - 4*a*b^3*c^3*d + 6*a^2*b^2*c^2*d^2 - 4*a*b^3*c*d^3 + (6*a^2*b^
2 - b^4)*d^4)*log(1/(tan(f*x + e)^2 + 1)) - 2*(b^4*c^3*d - 4*a*b^3*c^2*d^2 + b^4*c*d^3 - 4*a*b^3*d^4)*tan(f*x
+ e))/((c^2*d^3 + d^5)*f)

________________________________________________________________________________________

Sympy [A]  time = 15.5186, size = 2516, normalized size = 13.24 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))**4/(c+d*tan(f*x+e)),x)

[Out]

Piecewise((zoo*x*(a + b*tan(e))**4/tan(e), Eq(c, 0) & Eq(d, 0) & Eq(f, 0)), (-I*a**4*f*x*tan(e + f*x)/(-2*d*f*
tan(e + f*x) + 2*I*d*f) - a**4*f*x/(-2*d*f*tan(e + f*x) + 2*I*d*f) - I*a**4/(-2*d*f*tan(e + f*x) + 2*I*d*f) -
4*a**3*b*f*x*tan(e + f*x)/(-2*d*f*tan(e + f*x) + 2*I*d*f) + 4*I*a**3*b*f*x/(-2*d*f*tan(e + f*x) + 2*I*d*f) + 4
*a**3*b/(-2*d*f*tan(e + f*x) + 2*I*d*f) - 6*I*a**2*b**2*f*x*tan(e + f*x)/(-2*d*f*tan(e + f*x) + 2*I*d*f) - 6*a
**2*b**2*f*x/(-2*d*f*tan(e + f*x) + 2*I*d*f) - 6*a**2*b**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(-2*d*f*tan(e
 + f*x) + 2*I*d*f) + 6*I*a**2*b**2*log(tan(e + f*x)**2 + 1)/(-2*d*f*tan(e + f*x) + 2*I*d*f) + 6*I*a**2*b**2/(-
2*d*f*tan(e + f*x) + 2*I*d*f) + 12*a*b**3*f*x*tan(e + f*x)/(-2*d*f*tan(e + f*x) + 2*I*d*f) - 12*I*a*b**3*f*x/(
-2*d*f*tan(e + f*x) + 2*I*d*f) - 4*I*a*b**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(-2*d*f*tan(e + f*x) + 2*I*d
*f) - 4*a*b**3*log(tan(e + f*x)**2 + 1)/(-2*d*f*tan(e + f*x) + 2*I*d*f) - 8*a*b**3*tan(e + f*x)**2/(-2*d*f*tan
(e + f*x) + 2*I*d*f) - 12*a*b**3/(-2*d*f*tan(e + f*x) + 2*I*d*f) + 3*I*b**4*f*x*tan(e + f*x)/(-2*d*f*tan(e + f
*x) + 2*I*d*f) + 3*b**4*f*x/(-2*d*f*tan(e + f*x) + 2*I*d*f) + 2*b**4*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(-2
*d*f*tan(e + f*x) + 2*I*d*f) - 2*I*b**4*log(tan(e + f*x)**2 + 1)/(-2*d*f*tan(e + f*x) + 2*I*d*f) - b**4*tan(e
+ f*x)**3/(-2*d*f*tan(e + f*x) + 2*I*d*f) - I*b**4*tan(e + f*x)**2/(-2*d*f*tan(e + f*x) + 2*I*d*f) - 3*I*b**4/
(-2*d*f*tan(e + f*x) + 2*I*d*f), Eq(c, -I*d)), (-I*a**4*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) + 2*I*d*f) + a**4
*f*x/(2*d*f*tan(e + f*x) + 2*I*d*f) - I*a**4/(2*d*f*tan(e + f*x) + 2*I*d*f) + 4*a**3*b*f*x*tan(e + f*x)/(2*d*f
*tan(e + f*x) + 2*I*d*f) + 4*I*a**3*b*f*x/(2*d*f*tan(e + f*x) + 2*I*d*f) - 4*a**3*b/(2*d*f*tan(e + f*x) + 2*I*
d*f) - 6*I*a**2*b**2*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) + 2*I*d*f) + 6*a**2*b**2*f*x/(2*d*f*tan(e + f*x) + 2
*I*d*f) + 6*a**2*b**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*d*f*tan(e + f*x) + 2*I*d*f) + 6*I*a**2*b**2*log
(tan(e + f*x)**2 + 1)/(2*d*f*tan(e + f*x) + 2*I*d*f) + 6*I*a**2*b**2/(2*d*f*tan(e + f*x) + 2*I*d*f) - 12*a*b**
3*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) + 2*I*d*f) - 12*I*a*b**3*f*x/(2*d*f*tan(e + f*x) + 2*I*d*f) - 4*I*a*b**
3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*d*f*tan(e + f*x) + 2*I*d*f) + 4*a*b**3*log(tan(e + f*x)**2 + 1)/(2*
d*f*tan(e + f*x) + 2*I*d*f) + 8*a*b**3*tan(e + f*x)**2/(2*d*f*tan(e + f*x) + 2*I*d*f) + 12*a*b**3/(2*d*f*tan(e
 + f*x) + 2*I*d*f) + 3*I*b**4*f*x*tan(e + f*x)/(2*d*f*tan(e + f*x) + 2*I*d*f) - 3*b**4*f*x/(2*d*f*tan(e + f*x)
 + 2*I*d*f) - 2*b**4*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*d*f*tan(e + f*x) + 2*I*d*f) - 2*I*b**4*log(tan(e
 + f*x)**2 + 1)/(2*d*f*tan(e + f*x) + 2*I*d*f) + b**4*tan(e + f*x)**3/(2*d*f*tan(e + f*x) + 2*I*d*f) - I*b**4*
tan(e + f*x)**2/(2*d*f*tan(e + f*x) + 2*I*d*f) - 3*I*b**4/(2*d*f*tan(e + f*x) + 2*I*d*f), Eq(c, I*d)), ((a**4*
x + 2*a**3*b*log(tan(e + f*x)**2 + 1)/f - 6*a**2*b**2*x + 6*a**2*b**2*tan(e + f*x)/f - 2*a*b**3*log(tan(e + f*
x)**2 + 1)/f + 2*a*b**3*tan(e + f*x)**2/f + b**4*x + b**4*tan(e + f*x)**3/(3*f) - b**4*tan(e + f*x)/f)/c, Eq(d
, 0)), (x*(a + b*tan(e))**4/(c + d*tan(e)), Eq(f, 0)), (2*a**4*c*d**3*f*x/(2*c**2*d**3*f + 2*d**5*f) + 2*a**4*
d**4*log(c/d + tan(e + f*x))/(2*c**2*d**3*f + 2*d**5*f) - a**4*d**4*log(tan(e + f*x)**2 + 1)/(2*c**2*d**3*f +
2*d**5*f) - 8*a**3*b*c*d**3*log(c/d + tan(e + f*x))/(2*c**2*d**3*f + 2*d**5*f) + 4*a**3*b*c*d**3*log(tan(e + f
*x)**2 + 1)/(2*c**2*d**3*f + 2*d**5*f) + 8*a**3*b*d**4*f*x/(2*c**2*d**3*f + 2*d**5*f) + 12*a**2*b**2*c**2*d**2
*log(c/d + tan(e + f*x))/(2*c**2*d**3*f + 2*d**5*f) - 12*a**2*b**2*c*d**3*f*x/(2*c**2*d**3*f + 2*d**5*f) + 6*a
**2*b**2*d**4*log(tan(e + f*x)**2 + 1)/(2*c**2*d**3*f + 2*d**5*f) - 8*a*b**3*c**3*d*log(c/d + tan(e + f*x))/(2
*c**2*d**3*f + 2*d**5*f) + 8*a*b**3*c**2*d**2*tan(e + f*x)/(2*c**2*d**3*f + 2*d**5*f) - 4*a*b**3*c*d**3*log(ta
n(e + f*x)**2 + 1)/(2*c**2*d**3*f + 2*d**5*f) - 8*a*b**3*d**4*f*x/(2*c**2*d**3*f + 2*d**5*f) + 8*a*b**3*d**4*t
an(e + f*x)/(2*c**2*d**3*f + 2*d**5*f) + 2*b**4*c**4*log(c/d + tan(e + f*x))/(2*c**2*d**3*f + 2*d**5*f) - 2*b*
*4*c**3*d*tan(e + f*x)/(2*c**2*d**3*f + 2*d**5*f) + b**4*c**2*d**2*tan(e + f*x)**2/(2*c**2*d**3*f + 2*d**5*f)
+ 2*b**4*c*d**3*f*x/(2*c**2*d**3*f + 2*d**5*f) - 2*b**4*c*d**3*tan(e + f*x)/(2*c**2*d**3*f + 2*d**5*f) - b**4*
d**4*log(tan(e + f*x)**2 + 1)/(2*c**2*d**3*f + 2*d**5*f) + b**4*d**4*tan(e + f*x)**2/(2*c**2*d**3*f + 2*d**5*f
), True))

________________________________________________________________________________________

Giac [A]  time = 2.53693, size = 321, normalized size = 1.69 \begin{align*} \frac{\frac{2 \,{\left (a^{4} c - 6 \, a^{2} b^{2} c + b^{4} c + 4 \, a^{3} b d - 4 \, a b^{3} d\right )}{\left (f x + e\right )}}{c^{2} + d^{2}} + \frac{{\left (4 \, a^{3} b c - 4 \, a b^{3} c - a^{4} d + 6 \, a^{2} b^{2} d - b^{4} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}} + \frac{2 \,{\left (b^{4} c^{4} - 4 \, a b^{3} c^{3} d + 6 \, a^{2} b^{2} c^{2} d^{2} - 4 \, a^{3} b c d^{3} + a^{4} d^{4}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{2} d^{3} + d^{5}} + \frac{b^{4} d \tan \left (f x + e\right )^{2} - 2 \, b^{4} c \tan \left (f x + e\right ) + 8 \, a b^{3} d \tan \left (f x + e\right )}{d^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))^4/(c+d*tan(f*x+e)),x, algorithm="giac")

[Out]

1/2*(2*(a^4*c - 6*a^2*b^2*c + b^4*c + 4*a^3*b*d - 4*a*b^3*d)*(f*x + e)/(c^2 + d^2) + (4*a^3*b*c - 4*a*b^3*c -
a^4*d + 6*a^2*b^2*d - b^4*d)*log(tan(f*x + e)^2 + 1)/(c^2 + d^2) + 2*(b^4*c^4 - 4*a*b^3*c^3*d + 6*a^2*b^2*c^2*
d^2 - 4*a^3*b*c*d^3 + a^4*d^4)*log(abs(d*tan(f*x + e) + c))/(c^2*d^3 + d^5) + (b^4*d*tan(f*x + e)^2 - 2*b^4*c*
tan(f*x + e) + 8*a*b^3*d*tan(f*x + e))/d^2)/f